<?xml version="1.0" encoding="UTF-8"?>

<!--

(From http://www.w3.org/2005/rules/wg/wiki/Core/Positive_Conditions)

Example 2 (A RIF condition and its XML serialization):
  We use the prefix bks as an abbreviation for http://example.com/books#
  and amnt for http://example.com/amounts#

a. RIF condition

  And ( Exists ?Buyer ( purchase^^rif:local ( ?Buyer
                                              ?Seller
                                              cpt:book^^rif:iri
					      ?Author
					      bks:LeRif^^rif:iri
                                              amnt:USD49^^rif:iri )
        ?Seller=?Author )

b. XML serialization:

-->

<!DOCTYPE Document [
  <!ENTITY bks "http://example.com/books#">
  <!ENTITY cpt "http://example.com/concepts#">
  <!ENTITY amnt "http://example.com/amounts#">
  <!ENTITY ppl "http://example.com/people#">
  <!ENTITY dc  "http://purl.org/dc/terms/">
  <!ENTITY w3  "http://www.w3.org/">
  <!ENTITY rif "http://www.w3.org/2007/rif#">
  <!ENTITY op  "http://www.w3.org/2007/rif-builtin-predicate#">
  <!ENTITY fn  "http://www.w3.org/2007/rif-builtin-function#">
  <!ENTITY xs  "http://www.w3.org/2001/XMLSchema#">
]>

  <And
    xmlns="http://www.w3.org/2007/rif#"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xmlns:xs="http://www.w3.org/2001/XMLSchema">
     <formula>
       <Exists>
         <declare><Var>Buyer</Var></declare>
         <formula>
           <Atom>
             <op><Const type="&rif;iri">&cpt;purchase</Const></op>
             <args ordered="yes">
               <Var>Buyer</Var>
               <Var>Seller</Var>
               <Const type="&rif;iri">&cpt;book</Const>
	       <Var>Author</Var>
               <Const type="&rif;iri">&bks;LeRif</Const>
               <Const type="&rif;iri">&amnt;USD49</Const>
             </args>
           </Atom>
         </formula>
       </Exists>
     </formula>
     <formula>
       <Equal>
         <left><Var>Seller</Var></left>
         <right><Var>Author</Var></right>
       </Equal>
     </formula>
   </And>
